#pragma once

#include <vector>
#include <queue>
#include <ctime>
using namespace std;

#include "Particle.h"

class Emitter
{
	vector<Particle*> live_part;
	queue<Particle*> dead_part;

	// vector operations
	bool vTimeBased;
	bool vPointBased;
	bool vCircleBased;

	bool isLooping;

	// Emitter Position
	float Pos_X, Pos_Y, Pos_Z;

public:

	// number of Particles
	unsigned int NumParticles;

	// Transparency
	int Alpha_start;
	int Alpha_finish;

	// Particle Position Calculations
	float StartPos_X, StopPos_X;
	float StartPos_Y, StopPos_Y;
	float StartPos_Z, StopPos_Z;

	// Particle Velocity Calculations
	float StartVel_X, StopVel_X;
	float StartVel_Y, StopVel_Y;
	float StartVel_Z, StopVel_Z;

	// Particle Scale Calculations
	float StartScale_X, StopScale_X;
	float StartScale_Y, StopScale_Y;
	float StartScale_Z, StopScale_Z;

	// Average Offset Calculations
	float Offset_X, Offset_Y, Offset_Z;

	// Particles LifeTime
	float Lifetime;
	
public:
	Emitter(void);
	~Emitter(void);

	// Accessors
	bool GetTimeBased()		{ return vTimeBased; }
	bool GetPointBased()	{ return vPointBased; }
	bool GetCircleBased()	{ return vCircleBased; }
	bool GetisLooping()		{ return isLooping; }

	// Mutators
	void SetTimeBased(bool time)		{ vTimeBased = time; }
	void SetPointBased(bool point)		{ vPointBased = point; }
	void SetCircleBased(bool circle)	{ vCircleBased = circle; }
	void SetisLooping(bool loop)		{ isLooping = loop; }

	Emitter operator =(const Emitter &emitter);

	void ParticleReset(Particle particle);
	void StartEmitter(void);

	void Render(void);


	void Update(float elapsedTime);
};

